import http from '@/commons/request';

const ${bean.entityName!''}Api = {

	page: (params) => {
		return http({
			method: 'POST',
			url: ctx + "/${meta.name!}/${func._su.toViewName(bean.entityName)!}/list",
			data: params,
		});
	},

	view: (id) => {
		return http({
			method: 'GET',
			url: ctx + "/${meta.name!}/${func._su.toViewName(bean.entityName)!}/view",
			params: { "id": id }
		});
	},

	save: (it) => {
		return http({
			method: 'POST',
			url: ctx + "/${meta.name!}/${func._su.toViewName(bean.entityName)!}/save",
			data: it
		});
	},

	delete: (id) => {
		return http({
			method: 'POST',
			url: ctx + "/${meta.name!}/${func._su.toViewName(bean.entityName)!}/delete",
			params: { "id": id }
		});
	},

	exp: (params) => {
		return http({
			method: 'POST',
			url: ctx + "/${meta.name!}/${func._su.toViewName(bean.entityName)!}/exp",
			responseType: 'arraybuffer',
			params: params
		});
	},

	imp: (form_data) => {
		return http({
			method: 'POST',
			url: ctx + "/${meta.name!}/${func._su.toViewName(bean.entityName)!}/imp",
			data: form_data,
			headers: { 'Content-Type': undefined }
		});
	}
};

export { ${bean.entityName!''}Api };